<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        #result{
            width: 200px;      
            height: 100px;
            border: solid 5px #AA6699;
        }      
    </style>
</head>
<body>
    <button>ABC</button>
    <div id="result"></div>

    <script>
        const btn = document.querySelector('button');
        btn.onclick = function(){
            fetch('http://127.0.0.1:5000/test2', {
                method: 'post',
                headers: {
                    name: 'wldcmzy',
                },
                body: 'username=wld&password=cmzy'
            }).then(response => {
                console.log(response);
            });
        }
    </script>
</body>
</html>